Python RuntimeError: thread. _ init _ () not called Solution
This article mainly introduces the Python RuntimeError: thread. _ init _ () not called solution. For more information, see
An error is reported when writing a multi-threaded class.
RuntimeError: thread. _ init _
Processbefore the current process has finished its bootstrapping phase.
Solution Reference URL:
http://stackoverflow.com/questions/28830697/runtimeerror-on-windows-trying-python-multiprocessing?nsukey= 5vkoe8gsbste%2f%2fqyizt51u8wn7qty2k4srz0cau0owqnlesimj4uiwbqljshn7wobud3bdtmdzmmlbnrcpwgdsa% 2b25vmka7tghuhfk3udovjtcfiiaqquujkznfolm8ghsmtynxqtuxef99lzzl3qz8x%2b3ps4ny47eosby8sy8ukbqht2o9udmdg4qkggh8a
Well,
During this time, I wrote a crawling script using python, and used the breadth-first traversal to crawl pages. However, when the number of traversal attempts reaches 900, the following error occurs:
Runtimeerror: Maximum recursion depth exceeded
I checked on the Internet and found that the default recursive depth of python is very limited, probably more than 900
The following error occurs: runtimeerror: Second simultaneous read on fileno 8 detected. unless you really know what you're re doing, make sure that only one greenthread can read any participant socket. consider using a pools. pool. if you do know what you're doing and wantDisable this error, call eventlet. Debug. hub_multiple_reader_prevention (false)
2013-03-08 18:27:27 17870 TRACE glance.store.chunkcache.fake File "/usr/lib/python2.7/dist-packag
out the full arrangement (permutation ). For example, if the input values are 1, 2, 3, the entire array is 123,132,213,231,312,321.
Runtimeerror: Maximum recursion depth exceeded
I checked on the Internet and found that the default recursive depth of python is very limited, probably more than 900. When the recursive depth exceeds this value, this exception will be thrown.
The solution is to manually set
office2010 was installed on the WIN10 yesterday; Excel, PPT and other office software can be used normally, but word2010 not open, appear the error in the picture. Let me share with you the solution. This method is applicable not only to the error of WIN10 system, but also to the errors appearing in Win7 and WIN8 systems.
Tools/raw Materials
Windows Cleanup Assistant
office2010
Method/Step
1. Download Windows Cleanup Assistant
2, after downloading the installation of Windows C
Win7 system running software prompts runtime error resolution.
Runtime error, is a computer run program error to display the status of the Information Bar of the specific error code and the corresponding explanation. There are many reasons
[Python] Exception Handling Technology (2)
Re-raising Exceptions
In some cases, clearing jobs requires different error handling and correct handling. For example, if a database operation error occurs, you need to roll back the transaction, but there is no error, You need to perform the commit operation. In this case, you must capture an exception and process it. An intermediate layer exception needs to be captured and removed before some operations ar
A simple method to implement the type checker in Python 3, python type
Example Function
To develop a type checker, we need a simple function to experiment with it. The euclidean algorithm is a perfect example:
def gcd(a, b): '''Return the greatest common divisor of a and b.''' a = abs(a) b = abs(b) if a
In the preceding example, parameters a, B, and return values are of the int type. The expected types
started.Threading.main_thread ()Returns the main thread object. Under normal circumstances, the main thread is the one that the Python interpreter initiates.Threading.settrace (func)Set up a trace function for all threads started from the threading module. Before each thread's run () method is called, the function is passed to Sys.settrace () for each thread.Threading.setprofile (func)Set up a profile function for all threads started from the threadi
() method call, otherwise RuntimeError is thrown. Its initial value inherits from the thread that was created. The main thread is not an elf thread, so all threads that are created in the daemon default feel false.When no active non-sprite threads are executing. The entire Python program exits.9) Isdaemon ()Setdaemon ()The old Getter/setter API. This is now replaced directly with the daemon attribute.Lock
the thrown
Systemexit
thrown when the Python interpreter does not use the Sys.exit () function. If the code is not processed, the interpreter exits.
Thrown when an action or function is invalid on a specified data type
ValueError
thrown when a built-in function is a valid type for a data type, parameter , But the parameter specifies an invalid value
. _ setattr _ (self, '_ LocalProxy _ local', local)Object. _ setattr _ (self, '_ name _', name)
Def _ get_current_object (self ):"""Obtain the real object of the current proxy. Generally, this method is not called automatically unless youFor some performance reasons, you need to obtain the real object to be proxy, or you need to use it for anotherLocation."""# Here, we mainly determine whether the proxy object is a werkzeug Local object.# This logic is not used in the process.If not hasattr (sel
been garbage collected
RuntimeError
General run-time errors
Notimplementederror
Methods that have not been implemented
SyntaxError
Python syntax error
Indentationerror
Indentation Error
Taberror
Tab and Space Mix
Systemerror
General Interpreter system error
TypeError
An opera
, type, value, traceback): if type is None: try: self.gen.next() except StopIteration: pass else: raise RuntimeError("generator didn't stop") else: try: self.gen.throw(type, value, traceback) raise RuntimeError("generator didn't stop after throw()") except StopIteration: return True except: if sys.exc_info()[1] is not value
string, a class, or an object. Most Python core throws are classes, and some parameters are considered as class instance exceptions. It is easy to define new exceptions. For more information, see:
def functionName( level ): if level
Note: In order to catch an exception, the "escape T" statement must reference the exception that throws the same class object or a simple string. For example, to catch the above exception, you must write the limit t cla
) 0 (all data types)
Assertionerror
Assertion statement failed
Attributeerror
Object does not have this property
Eoferror
No built-in input, EOF Mark reached
EnvironmentError
Base class for operating system errors
IOError
Input/output operation failed
OSError
Operating system error
Windowserror
System call failed
Importerror
Failed to import modu
Python allows you to play music at regular intervals with an alarm clock and python to play music.
You can only play audio in wav format for your reference. The specific content is as follows:
Python code:
Import time import sys soundFile = 'sound.wav 'not_executed = 1 def soundStart (): if sys. platform [: 5] = 'linux ': import OS. popen2 ('aplay-Q' + soundFile)
has no built-in input to reach the EOF tag
EnvironmentError base class for operating system errors
IOError Input/output operation failed
OSError Operating system error
Windowserror system call failed
Importerror Import Module/object failed
Keyboardinterrupt user interrupt execution (usually input ^c)
Lookuperror base class for invalid data queries
There is no this index (index) in the indexerror sequence
This key is not in the Keyerror map
Memoryerror Memory overflow error (not fatal for
references (Weak reference) attempt to access objects that have been garbage collected
RuntimeError
General run-time errors
Notimplementederror
Methods that have not been implemented
SyntaxError
Python syntax error
Indentationerror
Indentation Error
Taberror
Tab and Space Mix
Systemerror
Genera
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.